package com.sias.realestate.web.service.impl;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sias.realestate.core.generic.GenericDao;
import com.sias.realestate.core.generic.GenericServiceImpl;
import com.sias.realestate.web.dao.MessageMapper;
import com.sias.realestate.web.model.Message;
import com.sias.realestate.web.service.MessageService;

@Service
public class MessageServiceImpl extends GenericServiceImpl<Message, Integer> implements MessageService{

	@Resource
	private MessageMapper messagemapper;


	@Override
    public int insert(Message model) {
        return messagemapper.insertSelective(model);
    }

    @Override
    public int update(Message model) {
        return messagemapper.updateByPrimaryKeySelective(model);
    }

    @Override
    public int delete(Integer id) {
        return messagemapper.deleteByPrimaryKey(id);
    }

    @Override
    public Message selectById(Integer id) {
        return messagemapper.selectByPrimaryKey(id);
    }
    
	@Override
	public List<Message> selectList() {
		// TODO Auto-generated method stub		
		return messagemapper.findAll();
	}
	@Override
	public GenericDao<Message, Integer> getDao() {
		// TODO Auto-generated method stub
		return messagemapper;
	}


	@Override
	public List<Message> findMessageByOid(Integer oid) {
		// TODO Auto-generated method stub
		return messagemapper.selectByOid(oid);
	}

	@Override
	public List<Message> findMessageByOidIfType(Integer oId, Integer mType) {
		// TODO Auto-generated method stub
		return messagemapper.selectByOidIfType(oId, mType);
	}


}
